package com.lhz.project.system.service.base.impl;

import com.lhz.framework.config.ThreadPoolConfig;
import com.lhz.framework.manager.threadManager.OperateLogThreadManager;
import com.lhz.framework.manager.threadManager.factory.AsyncBean;
import com.lhz.project.system.model.entity.auth.OperateLog;
import com.lhz.project.system.service.base.ApiService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @Author: LiHuaZhi
 * @Date: 2021/11/28 17:22
 * @Description:
 **/
@Service
class ApiServiceImpl implements ApiService {

    @Resource
    private ThreadPoolConfig threadPoolConfig;

    //系统日志
    @Override
    // @Async
    public void insertOperateLog(OperateLog log) {
        AsyncBean asyncSystemBean = new AsyncBean(OperateLogThreadManager.class, log.getId(), log);
        threadPoolConfig.start(asyncSystemBean);

    }
}
